<?php

require_once('request/AbstractActionRequest.class.php');

class InsertVoteRequest extends AbstractActionRequest {
	
	protected final function internalActionExecute($requestXml) {
		if($requestXml == null) {
			throw new Exception("Insufficient post data!");
			
			#$xml_data = '<Request><Vote><UserId>1</UserId><TopicId>1</TopicId></Vote></Request>';
			#$xml_data = '<Request><Vote><UserId>3</UserId><TopicId>2</TopicId></Vote></Request>';
			#$requestXml = simplexml_load_string($xml_data);
		}
		
		$created = time();
		$this->voteDao->insertVote($requestXml->Vote->UserId, $requestXml->Vote->TopicId, $created);
		
		return null;
	}
	
}

?>